/**
 * Definition for a binary tree node.
 * struct TreeNode {
 *     int val;
 *     struct TreeNode *left;
 *     struct TreeNode *right;
 * };
 */
/**
 * Note: The returned array must be malloced, assume caller calls free().
 */
 void postorder(struct TreeNode* root, int *ret,int* returnSize)
 {
     if (root==NULL) return;
     postorder(root->left, ret,returnSize);
     postorder(root->right, ret,returnSize);
     ret[(*returnSize)++]=root->val;

 }
int* postorderTraversal(struct TreeNode* root, int* returnSize) {
    int * ret=(int *)malloc(sizeof(int)*100);
    *returnSize=0;
    postorder(root, ret,returnSize);
    return ret;
}